#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int each_total(int n)
{
    int sum = 0;
    while (n > 0)
    {
        sum += (n % 10);
        n /= 10;
    }
    return sum;
}
int main()
{
    int a, b;
    int i = 0;
    int count = 0;
    scanf("%d %d", &a, &b);
    for (i = a; i <= b; i++)
    {
        int ret = each_total(i);
        if (ret % 5 == 0)
        {
            count++;
        }
    }
    printf("%d\n", count);
    return 0;
}